package com.htlwk.javapractice;

import java.util.function.Function;

/**
 * @ClassName FunctionDemo01
 * @Description TODO
 * @Author liaowenxiong
 * @Date 2024/12/24 19:36
 * @Version 1.0
 */
public class FunctionDemo01 {
    public static void main(String[] args) {
        String str = "55";
        Integer i = toInteger(str, Integer::valueOf);
        System.out.println(i);

    }

    public static Integer toInteger(String str, Function<String, Integer> function) {
        return function.apply(str);
    }

}
